if(applet.getProperty("background-image"))
{
	frame.getDesktopPane().setBackgroundImage(applet.getProperty("background-image"));
}
frame.setTitle(applet.getProperty("sitename"));

var outerBox = javax.swing.Box.createVerticalBox();

var innerBox = javax.swing.Box.createVerticalBox();
innerBox.setBorder(javax.swing.BorderFactory.createTitledBorder("Enter your credentials"));

var usernameField = new javax.swing.JTextField(30);
var passwordField = new javax.swing.JPasswordField(30);
var launchButton = new javax.swing.JButton("Log In");

launchFunction = function(e) {
    props = new java.util.HashMap();
    props.put("host", applet.getProperty("host"));
    props.put("port", applet.getProperty("port"));
    props.put("sitename", applet.getProperty("sitename"));
    props.put("jms-url", applet.getProperty("jms-url"));
    props.put("initial-command", "connect " + usernameField.text + " " + passwordField.text);
    applet.runApplet("default.xml", props);
    frame.dispose();
}

usernameField.addActionListener(launchFunction);
passwordField.addActionListener(launchFunction);
launchButton.addActionListener(launchFunction);

innerBox.add(new javax.swing.JLabel("User name:"));
innerBox.add(usernameField);
innerBox.add(new javax.swing.JLabel("Password:"));
innerBox.add(passwordField);
innerBox.add(launchButton);

banner = new javax.swing.JLabel("Welcome to " + applet.getProperty("sitename"));
banner.setFont(new java.awt.Font("Times New Roman", java.awt.Font.PLAIN, 24));

outerBox.add(banner);
outerBox.add(innerBox);

frame.add(outerBox);
frame.pack();

outerWidthDelta  = (frame.getDesktopPane().getWidth() - frame.getWidth()) / 2;
outerHeightDelta = (frame.getDesktopPane().getHeight() - frame.getHeight()) / 2;

frame.reshape(outerWidthDelta, outerHeightDelta, frame.getWidth(), frame.getHeight());
